/* this prevents dom flickering, needs to be outside of dom.ready event: */
document.documentElement.className += 'js_active';
/*end dom flickering =) */



jQuery.noConflict();

jQuery(document).ready(function(){

	var url = jQuery("meta[name=temp_url]").attr('content') + '/send.php',
		php_autorotation = jQuery("meta[name=autorotate]").attr('content'),
		php_autorotationDelay = jQuery("meta[name=autorotateDelay]").attr('content'),
		php_animationSpeed = parseInt(jQuery("meta[name=autorotateSpeed]").attr('content'));
		
		php_autorotation = php_autorotation == 2 ? false : true;
		
		
	// activates the lightbox page, if you are using a dark color scheme use another theme parameter
	my_lightbox("a[rel^='prettyPhoto'], a[rel^='lightbox']");
	
	
	//k_form(); //controls the contact form
	k_menu(); // controls the dropdown menu
	k_pixelperfect();
	
	
	
	// accordion slider
	jQuery("#featured").not('.fadeslider, .newsslider').kricordion({
			slides: '.featured',		// wich element inside the container should serve as slide
			animationSpeed: php_animationSpeed,		// animation duration in milliseconds
			autorotation: php_autorotation,			// autorotation true or false?
			autorotationSpeed:php_autorotationDelay,		// duration between autorotation switch in Seconds
			event: 'mouseover',			// event to focus a slide: mouseover or click
			imageShadow:true,			// should the image get a drop shadow to the left
			easing: 'easeOutQuart',		// easing method
			imageShadowStrength:0.5		// how dark should that shadow be, recommended values: between 0.3 and 0.8, allowed between 0 and 1
	});
	
	
	// fading slider
	jQuery('.fadeslider').kriesi_fade_slider({
			slides: '.featured',				// wich element inside the container should serve as slide
			animationSpeed: php_animationSpeed,				// animation duration in milliseconds
			autorotation: php_autorotation,					// autorotation true or false?
			autorotationSpeed:php_autorotationDelay,				// duration between autorotation switch in Seconds
			appendControlls: '#feature_wrap'	//element to append the controlls to
	});
	
	
	// news slider
	jQuery('.newsslider').kriesi_news_slider({
			slides: '.featured',				// wich element inside the container should serve as slide
			animationSpeed: php_animationSpeed	// animation duration in milliseconds
	});

	

	jQuery('.ajax_form').kriesi_ajax_form({sendPath:url});	// activates contact form
	jQuery('.news_form').kriesi_ajax_form({sendPath:url});	// activates news submit form
	jQuery('input:text').kriesi_empty_input();	// comment form improvement
	
	jQuery('#main').kriesi_image_preloader({delay:100, callback:removeloader});	// activates preloader for non-slideshow images

});

function removeloader()
{
	jQuery('#main .preloading_background').removeClass('preloading_background');
	jQuery('.fadeslider .featured').css('backgroundImage','none');
};
